#!/usr/bin/python
# -*- coding: utf-8 -*-

# def user_info(name, age, gender):
#     print(f'姓名是{name}, 年龄是{age}, 性别是{gender}')
#
# user_info('Tom', '18', '男')
# user_info(name = 'lili', age = '21', gender = '女')


# def user_info(name, age, gender, country = '中国'):
#     print(f'姓名是{name}, 年龄是{age}, 性别是{gender}, 国籍是{country}')
#
# user_info('Tom', '18', '男', '中国香港')
# user_info(name = 'lili', age = '21', gender = '女', country= '中国台湾')


#不定长参数
#一，包裹位置参数传递
# def print_info(*args):
#     print(args)
#
# print_info()
# print_info('小明')
# list1 = [1, 2, 3, 4]
# #不定长传参需要加*，否则会将序列作为一整个元素传递进去
# print_info(*list1)


#二，包裹关键字传递
# def print_info2(**kwargs):
#     print(kwargs)
#
# #调用
# print_info2()
# print_info2(name = 'lili')
# dict1 = {'name': 'TOM', 'age': 18, 'id': 110}
# print_info2(**dict1)
#
# def fun1():
#     return 100, 200
#
# res = fun1()
# res1, res2 = res
# print(res1)
# print(res2)
#
# dict1 = {'name':'Tom', 'age' : '18'}
# a, b =dict1.items()
# print(a)
# print(b)


# #交换两个变量的值
# a = 100
# b = 200
#
# #方法一，临时变量更替
# c = a
# a = b
# b = c
# print(a)
# print(b)
#
# #方法二
# a, b = b, a
# print(a)
# print(b)


# a = 1
# b = a
#
# print(b)
# print(id(a))
# print(id(b))

# aa = [10, 20]
# bb = aa
# print(id(aa))
# print(id(bb))
# print(aa)
# print(bb)
# aa.append(30)
# print(id(aa))
# print(id(bb))
# print(aa)
# print(bb)



def fun1(a):
    print(a)
    print(id(a))

    a += a

    print(a)
    print(id(a))

#int
b = 100
fun1(b)

#list
c = [11, 22]
fun1(c)



